﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GJ_Model.Interface;
using DataConnection.Interface;
using DataConnection.Factory;
using System.Data;

namespace GJ_Model.BE
{
    public class GJ_Model_OperationBE:IGJ_Model_OperationOper
    {
        IDataOperationInterface DataOper = DataConFactory.CreateDataOperationOper();
        /// <summary>
        /// 得到查询结果
        /// </summary>
        /// <param name="strSql"></param>
        /// <returns></returns>
        public object GetDataObject(string strSql)
        {
            try
            {
                string sql = " select * from GJ_AllInfo ";
                return DataOper.SqlExecuteString(sql);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        /// <summary>
        /// 得到所有的信息
        /// </summary>
        /// <returns></returns>
        public DataTable GetDataTableAll()
        {
            try
            {
                string sql = " select Id,GJNum,GJName,GJValues from GJ_AllInfo ";
                return DataOper.SqlExecuteGetDataTable(sql);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        /// <summary>
        /// 得到处理后数据
        /// </summary>
        /// <returns></returns>
        public Dictionary<string, string[]> GetAllData(out Dictionary<string,string[]> GJStationData)
        {
            try
            {
                GJDataOperation daOper = new GJDataOperation();
                daOper.GetAllData(GetDataTableAll());
                GJStationData = new Dictionary<string, string[]>();
                GJStationData = GJDataOperation.GJAllDataStation;
                return GJDataOperation.GJAllDataGJName;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}
